<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:rich="http://richfaces.org/rich"
      xmlns:common="http://www.contact.common.com/contacts/ui"
      xmlns:a4j="http://richfaces.org/a4j"
      xmlns:core="http://www.contact.core.com/contacts/core/ui">

<ui:component>
    <link rel="stylesheet" type="text/css" href="./style/css/main.css"/>
    <!--@elvariable id="id" type="java.lang.String"-->
    <common:modalPanel id="#{id}"
                       header="#{resources.loginLabel}"
                       bean="#{welcome}"

            >
        <ui:define name="panelBody">
            <rich:panel style="overflow:auto; margin-bottom:20px;  width:250px;"
                        bodyClass="rich-laguna-panel-no-header">
                <h:outputLabel style="color:red" value="#{resources.notLoginText}"/>
                <br/>
                <h:outputLabel style="color:gray" value="#{resources.noCreateAccountText}">
                    <a4j:commandLink id="singUpButton"
                                     value="#{resources.createAccountButton}."
                                     limitToList="true"
                                     reRender="signUpAddModalPanel"
                                     action="#{welcome.prepareToAddNewAccount}"
                                     oncomplete="Richfaces.showModalPanel('signUpAddModalPanel'); Richfaces.hideModalPanel('#{id}'); "
                            />
                </h:outputLabel>
            </rich:panel>
            <h:panelGrid style="width:100%; " columns="2">

                <h:panelGroup style="text-align:right;font:10;;" layout="block">
                    <h:outputLabel value="#{resources.emailLabel}"/>
                </h:panelGroup>
                <h:inputText value="#{welcome.autentificate.mail}"/>

                <h:panelGroup style="text-align:right;font:10; " layout="block">
                    <h:outputLabel value="#{resources.passwordLabel}"/>
                </h:panelGroup>
                <h:inputSecret value="#{welcome.autentificate.password}" redisplay="true"/>

                <h:column rendered="#{not empty welcome.autentificate.mail}"/>
                <h:outputText value="Username #{welcome.autentificate.mail} or password not valid!"
                              style="color:red;"
                              rendered="#{not empty welcome.autentificate.mail}"
                        />
            </h:panelGrid>


        </ui:define>
        <ui:define name="actionCommand">
            <a4j:commandButton id="submitButton"
                               type="submit"
                               styleClass="button"
                               value="#{resources.loginLabel}"
                               action="#{welcome.loginFromA4j}"
                               reRender="#{resources.resetButton}"
                    />
            <a4j:commandButton id="resetButton"
                               styleClass="button"
                               type="reset"
                               reRender="signUpAddModalPanelForm"
                               value="#{resources.cancelButton}"
                               oncomplete=" Richfaces.hideModalPanel('#{id}');"
                    />

        </ui:define>

    </common:modalPanel>


</ui:component>


</html>
